import { ref } from 'vue'
import builtinComponents from 'gt-graphic/components/builtin'

const labelMap: Record<string, string> = {
  math: '数学',
  param: '参数'
}

export function useBuiltinComponents() {
  const result = ref<GtGraphic.Menu[]>([])

  for (const [name, children] of Object.entries(builtinComponents)) {
    result.value.push({ label: labelMap[name], name, children })
  }

  return result
}
